<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扩展运算符 ****</title>
</head>
<body>
    <script>
        //扩展运算符其实是 rest 参数的逆运算  ...
        // ...数组： 将数组里面的每一个元素，拆散成以逗号隔开的形式
        // let arr = ['张天爱','迪丽热巴','古力娜扎','热依扎','佟丽娅'];

        // function test(){
        //     console.log(arguments);
        // }
        // test(...arr);// test('张天爱','迪丽热巴','古力娜扎','热依扎','佟丽娅')

        //数组的展开 
        
        let arr = [1,2,3,4];
        let arr1 = [5,6,7];

        let arr2 = [...arr,...arr1];
        console.log(arr2);
        //对象的展开  

        let obj1 = {
            q:'金钟罩',
            w:'闪现',
            a:'冰雹啸'
        }
        let obj2 = {
            a:'惩戒',//同名属性会发生覆盖，谁在后面谁生效
            j:'催筋断骨'
        }

        let obj3 = {...obj1,...obj2};
        console.log(obj3);

        
        
    </script>
    
</body>
</html>